<!--
 * @Description: 
 * @Author: zzj
 * @Date: 2021-10-11 12:13:08
 * @LastEditors: zzj
 * @LastEditTime: 2021-10-11 17:57:05
-->
<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>组件</title>
	<script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.9/vue.js"></script>
	<link href="https://cdn.bootcdn.net/ajax/libs/element-ui/2.15.3/theme-chalk/index.css" rel="stylesheet">
	<script src="https://cdn.bootcdn.net/ajax/libs/element-ui/2.15.3/index.js"></script>
</head>

<body>
	<div id="app">
		<el-table :data="articles">
			<el-table-column label="编号" type="index" :index="1"></el-table-column>
			<el-table-column label="标题" prop="title"></el-table-column>
			<el-table-column label="内容" prop="content"></el-table-column>
			<el-table-column label="操作" >
				<template slot-scope="scope">
					<el-button size="mini" @click="delHandler(scope.row)">删除</el-button>
					<el-button size="mini" @click="editHandler(scope.row)">修改</el-button>
				</template>
			</el-table-column>
		</el-table>
		<el-pagination @current-change="pageChangeHandler" layout="prev, pager, next" :total="50">
		</el-pagination>
	</div>

	<script>

		new Vue({
			el: "#app",
			data: {
				visible: true,
				articles: [
					{ id: 1, title: "xxx", content: "xxxxxx" },
					{ id: 2, title: "ccc", content: "cccccc" },
					{ id: 3, title: "vvv", content: "vvvvv" }
				]
			},
			methods:{
				delHandler(){
					alert(row.id)
				},
				editHandler(){
					alert(JSON.stringify(row));
				},
				pageChangeHandler(current){
					alert(current)
				}
			}
		})
	</script>
</body>

</html>